<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use DB;
use View;
class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {


//         //全局共享变量

         $user_photo=DB::table('user_info')->where('id','=',1)->first();
         $user_name=DB::table('users')->where('id','=',1)->first();
         $user_name=$user_name->name;
         $user_photo=$user_photo->photo;

         View::share('user_photo',$user_photo);
         View::share('user_name',$user_name);


    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
